package com.example.hotel.service.impl;

import com.example.hotel.dao.ItemDao;
import com.example.hotel.entity.Item;
import com.example.hotel.service.ItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class ItemServiceImpl implements ItemService {

    @Autowired
    private ItemDao itemDao;

    @Override
    @Transactional
    public int insert(Item item) {
        int r = itemDao.insert(item);

        return r;
    }

    @Override
    public List<Item> findAll() {
        return itemDao.findAll();
    }

    @Override
    public int deleteById(int item_id) {
        return itemDao.deleteById(item_id);
    }

    @Override
    public int update(Item item) {
        return itemDao.update(item);
    }

}

